from django.db import models

# Create your models here.
# insert into axf_foodtype(typeid,typename,childtypenames,typesort)
class AxfFoodType(models.Model):
    typeid = models.CharField(max_length=32)
    typename = models.CharField(max_length=64)
    childtypenames = models.CharField(max_length=128)
    typesort = models.IntegerField()

    class Meta:
        db_table = 'axf_foodtype'

# id, productid, productimg, productname, productlongname, isxf, pmdesc, specifics, price, \
# marketprice, categoryid, childcid, childcidname, dealerid, storenums, productnum
class AxfGoods(models.Model):
    productid = models.IntegerField()
    productimg = models.CharField(max_length=64)
    productname = models.CharField(max_length=64)
    productlongname = models.CharField(max_length=128)
    isxf = models.BooleanField(default=False)  # 是否新鲜

    pmdesc = models.IntegerField()
    specifics = models.CharField(max_length=32)  # 商品详情
    price = models.FloatField()  # 价格
    marketprice = models.FloatField()  # 超市价格
    categoryid = models.IntegerField()  # 类别的id
    childcid = models.IntegerField()  # 子类别的id 用于 二级联动 三级联动

    childcidname = models.CharField(max_length=128)
    dealerid = models.IntegerField()  # 商家id
    storenums = models.IntegerField()  # 商店的储备数量
    productnum = models.IntegerField()  # 商品的数量

    class Meta:
        db_table = 'axf_goods'